﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="LikeTry._Default" %>
<%@ Import Namespace="LikeTry.Logic" %>
<%@ Import Namespace="System.Collections.Generic" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 8px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    Welcome LikeTry agent
    <asp:Button ID="Button2" runat="server" Text="Exit" onclick="Button2_Click" />
    </div>

    帐号管理<br />
    <br />
    <asp:Button ID="Button1" runat="server" Text="添加新帐户" onclick="Button1_Click" />
    <br />
    <br />

    <table>
    <%
        var isAdmin = Request.QueryString["admin"] != null;
        

            var accountObj = LikeTryCore.LikeTry.GetAccountList();
            foreach (var item in accountObj)
            {
                %>
                <tr>
    <td><b><%=item.Name %></b></td>
     <td> <a href="previewer.aspx?id=<%=item.Id %>" target="_blank"><b><span style="color:Red">Preview</span></b></a></td>
    <% if(isAdmin) 
       {%>
       <td> <a href="Default.aspx?oper=delete&id=<%=item.Id %>"><b><span style="color:Red">Delete</span></b></a></td>
       <%
       }
       %>
    </tr>
                <%
            }
    %>
    
    </table>
    </form>
</body>
</html>
